
<template>
  <view class="page">
    <view class="container">
      <!-- 顶部波浪背景 -->
      <view class="wave-header">
        <view class="title">前端帽子</view>
        <view class="subtitle">FRONTHAT，帽子先生</view>
      </view>

      <!-- 表单区域 -->
      <view class="form-container">
        <!-- 邮件输入框 -->
        <view class="input-group">
          <uni-icons type="email" size="20" color="#666"></uni-icons>
          <input 
            type="text"
            class="input"
            placeholder="邮件/两字短码"
            v-model="form.email"
          />
          <uni-icons 
            v-if="form.email"
            type="clear" 
            size="20" 
            color="#999"
            @click="form.email = ''"
          ></uni-icons>
        </view>

        <!-- 验证码输入框 -->
        <view class="input-group verify-group">
          <uni-icons type="locked" size="20" color="#666"></uni-icons>
          <input
            type="text"
            class="input"
            placeholder="输入框/三字短码"
            v-model="form.code"
          />
          <button class="verify-btn">验证码</button>
        </view>

        <!-- 登录按钮 -->
        <button class="login-btn" @click="handleLogin">立即登录</button>

        <!-- 底部链接 -->
        <view class="bottom-links">
          <text class="link">注册账号</text>
          <text class="link">忘记密码</text>
        </view>
      </view>
    </view>
  </view>
</template>

<script lang="ts" setup>
import { reactive } from 'vue';

const form = reactive({
  email: '',
  code: ''
});

const handleLogin = () => {
  console.log('Login with:', form);
};
</script>

<style>
page {
  height: 100%;
}

.page {
  height: 100%;
  background: linear-gradient(135deg, #4e54c8, #8f94fb);
}

.container {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 40rpx;
}

.wave-header {
  padding: 120rpx 0 160rpx;
  text-align: center;
  position: relative;
}

.title {
  font-size: 48rpx;
  color: #ffffff;
  font-weight: bold;
  margin-bottom: 20rpx;
}

.subtitle {
  font-size: 28rpx;
  color: rgba(255, 255, 255, 0.8);
}

.form-container {
  background: #ffffff;
  border-radius: 24rpx;
  padding: 60rpx 40rpx;
  box-shadow: 0 4rpx 30rpx rgba(0, 0, 0, 0.1);
}

.input-group {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding: 20rpx 0;
  margin-bottom: 40rpx;
}

.input {
  flex: 1;
  margin: 0 20rpx;
  font-size: 28rpx;
  color: #333;
}

.verify-group {
  margin-bottom: 60rpx;
}

.verify-btn {
  width: 160rpx;
  height: 60rpx;
  line-height: 60rpx;
  font-size: 24rpx;
  color: #4e54c8;
  background: rgba(78, 84, 200, 0.1);
  border-radius: 30rpx;
  padding: 0;
  margin: 0;
}

.login-btn {
  width: 100%;
  height: 90rpx;
  line-height: 90rpx;
  background: linear-gradient(135deg, #4e54c8, #8f94fb);
  color: #ffffff;
  font-size: 32rpx;
  border-radius: 45rpx;
  margin-bottom: 40rpx;
  box-shadow: 0 4rpx 20rpx rgba(78, 84, 200, 0.3);
}

.bottom-links {
  display: flex;
  justify-content: space-between;
}

.link {
  font-size: 28rpx;
  color: #4e54c8;
}

/* 输入框动画效果 */
.input-group:focus-within {
  border-color: #4e54c8;
}

/* 按钮点击效果 */
.login-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}
</style>

